package com.lg.java;

import lombok.SneakyThrows;

import java.nio.file.*;
import java.nio.file.attribute.BasicFileAttributes;
import java.util.ArrayList;

public class WalkFileTree {
    @SneakyThrows
    public static void main(String[] args) {
        ArrayList<Path> paths = new ArrayList<>();

        Path path = Files.walkFileTree(Paths.get("C:\\coding\\burning"),
                new SimpleFileVisitor<Path>() {
                    @Override
                    public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) {
                        return FileVisitResult.CONTINUE;
                    }

                    @Override
                    public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) {
                        paths.add(file);
                        return FileVisitResult.CONTINUE;
                    }
                });


//        WalkFileTree walkFileTree = new WalkFileTree();
//        walkFileTree.fun(1);
    }


    private void  fun(int num) {
        System.out.println(num);
        this.fun(num + 1);
    }
}
